#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    QPushButton* btn = new QPushButton("上课了",this);
    resize(800,600);
    btn->move(100,100);

    this->tch = new Teacher(this);
    this->stu = new student(this);

    connect(btn,&QPushButton::clicked,tch,&Teacher::MySignal);
    connect(tch,&Teacher::MySignal,stu,&student::StarStudy);

    EmitSignal();
}

Widget::~Widget()
{
    delete ui;
}


void Widget::EmitSignal()
{
    emit tch->MySignal();
}
